#include<stdio.h>
#include<fcntl.h>
#include<unistd.h>
#include<stdlib.h>
#include<string.h>
#include<sys/types.h>

int main(int argc, char const *argv[])
{
    int fd1 = open("file.txt", O_RDWR | O_CREAT | O_TRUNC, 0644);
    int fd2 = open("file.txt", O_RDWR);

    lseek(fd2, 100, SEEK_SET);

    write(fd1, "abc", 3);
    write(fd2, "xyz", 3);

    close(fd1);
    close(fd2);
    return 0;
}
